import '../../domain/entities/counter.dart';
import '../../domain/repositories/counter_repository.dart';
import '../datasources/counter_local_data_source.dart';
import '../models/counter_model.dart'; // Add this import

class CounterRepositoryImpl implements CounterRepository {
  final CounterLocalDataSource localDataSource;

  CounterRepositoryImpl(this.localDataSource);

  @override
  Counter getCounter() {
    return localDataSource.fetchCounter();
  }

  @override
  void saveCounter(Counter counter) {
    localDataSource.saveCounter(CounterModel(counter.value));
  }
}